COM Wrapper block

The COM Wrapper block allows the user to integrate external COM (Component Object Model) components within the Architect environment. In this way the user can add custom functionality (e.g., in cases where the script block is not sufficient), own code/libraries, or third party libraries/components to his/her solution.

NOTE: CSense provides secure native blocks and operations for building analytics and solutions. The native capabilities provided by CSense can be extended by making use of this feature. When making use of this feature, please ensure that you have validated your extended functions to ensure that they perform as intended and do not introduce stability or security risks to your production system. Do not use scripts or components from untrusted sources.

COM Wrapper block

Description

External COM (Component Object Model) components that contain custom functionality (e.g., own code, libraries, or components) can be integrated within the Architect environment using the COM Wrapper block. The integrated component can then interface and communicate with any other Architect block. COM is used since it provides a standard way for software components to communicate in Microsoft Windows. There is also strong support for COM in Microsoft development tools such as Visual Basic and Visual C++.

The COM Wrapper is a COM client (software that uses a component), whereas the user’s COM component, typically Visual Basic or Visual C++ code compiled as a dynamic link library or executable file, is the COM server (software that acts as a component). A COM server exposes an interface (collection of functions) that in turn allows COM clients to call functions on the server interface. A COM component (COM server) is packaged and distributed in a DLL file and needs to be registered in Windows for clients to find it. The COM Wrapper block can provide a user interface to manage the properties of the COM component. A COM component can provide its own user interface for property management component and stores its parameters in a blueprint. The COM component provides the configuration user interface that is called by the COM Wrapper block via the pre-defined COM interface. The COM Wrapper block maps input fields to the COM component’s input variables and its output fields to the component’s output variables.

The COM Wrapper’s operation is as follows:

  • Queries input variable list

  • Queries output variable list

  • Queries properties list

  • Invokes component configuration GUI

  • Persists (saves) component configuration in blueprint

The component interface is as follows:

Offline functions
  • GetInputVariableList

  • GetOutputVariableList

  • GetPropertyList

  • ShowEditor

Persistence functions
  • VB: Read/WriteProperties

The component implementation restrictions are as follows:

  • The values of time variables use GMT

Block Type

Rules & Models block

Input/Output ports

The block contains one input port that must contain input fields of the same type as the COM component’s input variables. The output port of the block contains the COM component’s output variables.  The output field name can be modified in the block configuration.

In order for this block to run, the COM Wrapper must be connected to the COM component, the COM component’s input variables must be mapped to the COM wrapper’s input fields, and values must be specified for the parameters of the COM component.

Functions performed on tags
  • On the values – The input values are sent through the COM Wrapper block and the calculated output value(s) of the COM component are placed in the COM Wrapper’s output fields.

  • On the timestamp – The time stamp of the output fields will be set to the newest timestamp of the input fields.

  • On the quality – If any one of the input values has bad quality, then the output value(s) will also be of bad quality.

Example

For three examples of how to write a third party COM component in Visual Basic (to be used in the Architect environment) see Writing a COM component. The first example implements a simple mathematical function, the second one adds a configuration GUI to the first component, and the third example adds component persistence so that the blueprint can keep parameters. These components can then be integrated within the Architect environment using the COM Wrapper block.


Related topics:

  

CSense 2023- Last updated: June 24,2025